<script setup lang="ts">
import {
  darkTheme,
  NMessageProvider,
  NConfigProvider,
  NDialogProvider,
  NModalProvider,
  NGlobalStyle,
  zhCN,
  dateZhCN,
} from 'naive-ui'

import { useCounterStore } from './stores/counter'
const { increment } = useCounterStore()
increment()

// 应用启动时获取用户登录状态相关信息
import { useUserStore } from './stores/userStore'
const { updateUserInfo } = useUserStore()

updateUserInfo((islogin) => {
  console.log('是否登录：', islogin)
})
</script>

<template>
  <NConfigProvider :theme="darkTheme" :locale="zhCN" :date-locale="dateZhCN">
    <NGlobalStyle />
    <NDialogProvider>
      <NMessageProvider>
        <NModalProvider>
          <RouterView />
        </NModalProvider>
      </NMessageProvider>
    </NDialogProvider>
  </NConfigProvider>
</template>

<style scoped></style>
